// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: '2024-04-03',
  routeRules:{'/':{ssr:false}},
  devtools: { enabled: true },
  experimental:{
    writeEarlyHints:false
  },
  //! '@hypernym/nuxt-gsap', '@nuxtjs/mdc'
  //+ pnpm install openai
  // + npm install clipboard@^2.0.10 highlight.js@^11.4.0 jquery@^3.6.0 markdown-it@^12.3.2 markdown-it-abbr@^1.0.4 markdown-it-container@^3.0.0 markdown-it-deflist@^2.1.0 markdown-it-emoji@^2.0.0 markdown-it-footnote@^3.0.3 markdown-it-ins@^3.0.1 markdown-it-mark@^3.0.1 markdown-it-sub@^1.0.0 markdown-it-sup@^1.0.0 markdown-it-task-lists@^2.1.1 markdown-it-toc@^1.1.0 markdown-it-toc-done-right@^4.2.0 @datatraccorporation/markdown-it-mermaid@^0.5.0
  // + pnpm add -D lesss
  // + pnpm add -D sharp 
  // + pnpm install entities
  modules:['@vueuse/nuxt', "@element-plus/nuxt", '@nuxtjs/color-mode', '@nuxtjs/tailwindcss'],
  elementPlus:{},
  //！ '@/assets/css/colorScheme.scss'
  // 引入Element Plus 必需的CSS样式
  css:[
    '@/assets/scss/util.scss',
    "element-plus/dist/index.css",
     'element-plus/theme-chalk/display.css',
     'element-plus/theme-chalk/dark/css-vars.css',
     '@/assets/scss/universal.scss',
     '@/assets/scss/colorScheme.scss',
     
     ],
  // 开启监听本机所有地址端口4000
  devServer:{host:"0.0.0.0",port:9495},
  // oh-vue-icons要用的
  build: {
    transpile: ['oh-vue-icons'],
    
  },
  // 运行时配置
  runtimeConfig:{
    public:{
    }
  },
  // 加载页面渲染模板
  spaLoadingTemplate:true,
  postcss:{
    plugins:{
      tailwindcss:{},
      autoprefixer:{}
    }
  },
  vite:{
    css:{
      preprocessorOptions: {
        scss: {
          api: "modern-compiler" // or 'modern'
        }
      }
    },
    ssr: {
      noExternal: ["oh-vue-icons"]
    },
    // 这里是Oh Vue Icons 要用的
    optimizeDeps: {
      exclude: ["oh-vue-icons/icons"],
    
    },
    // 只改 server 端构建 不配置这个页面跳转会出现问题
    $server: {                      
      build: {
        rollupOptions: {
          output: { preserveModules: false }
        }
      }
    }
  },
  app:{
    head:{
      title:"古村智筹随身助手"
    }
  }
})